package cn.ssm.biz.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Service;

import cn.ssm.biz.ClassroomBiz;
import cn.ssm.dao.ClassroomMapper;
import cn.ssm.pojo.Class;
import cn.ssm.pojo.Pager;

@Service("ClassroomBizImpl")
public class ClassroomBizImpl implements ClassroomBiz {

	 @Autowired
	 @Qualifier("ClassroomMapper")
	 private ClassroomMapper cm;

	 
	 
	@Override
	public int insertClass(Class clr) {
		// TODO Auto-generated method stub
		return cm.insertClass(clr);
	}

	@Override
	public int delClass(int id) {
		// TODO Auto-generated method stub
		return cm.delClass(id);
	}

	@Override
	public int updateClass(Class clr) {
		// TODO Auto-generated method stub
		return cm.updateClass(clr);
	}

	@Override
	public List<Class> classroomInfo(Pager pager) {
		// TODO Auto-generated method stub
		int form =(pager.getCurrentPage()-1)*(pager.getRowPerPage());
		return cm.classInfo(form, pager.getRowPerPage());
	}

	@Override
	public int selectIdByName(String calssroomName) {
		// TODO Auto-generated method stub
		return cm.selectIdByName(calssroomName);
	}
	@Override
	public Class selectByID(int id) {
		return cm.selectByID(id);
	}
	public ClassroomMapper getCm() {
		return cm;
	}

	public void setCm(ClassroomMapper cm) {
		this.cm = cm;
	}

	@Override
	public int findClassCount() {
		// TODO Auto-generated method stub
		return cm.selectClassCount();
	}

	@Override
	public List<Class> classroomInfo1() {
		// TODO Auto-generated method stub
		return cm.classInfo1();
	}

	@Override
	public List<Class> classInfoById(int id, int form, int pageSize) {
		// TODO Auto-generated method stub
		return cm.classInfoById(id, form, pageSize);
	}

	@Override
	public int getcomputerroomByClassId(int id) {
		// TODO Auto-generated method stub
		return cm.selectcomputerroomByClassId(id);
	}

	
  
}
